//弹出层
jQuery(document).ready(function($) {
    $('#problem').click(function(){
        $('.desk').fadeIn(100);
        $('.layerDiv').slideDown(200);
    })
    $('.closeDiv').click(function(){
        $('.desk').fadeOut(100);
        $('.layerDiv').slideUp(200);
    })
})

//tab切换
$(document).ready(function(){
    var $tab_li = $('.platab_menu ul li');
    $tab_li.click(function(){
        $(this).addClass('selected').siblings().removeClass('selected');
        var index = $tab_li.index(this);
        $('div.platab_box > div').eq(index).show().siblings().hide();
    });
});
$(function(){
    $(window).on('scroll', function(){
        if($(window).scrollTop() > 820){
            $('.scroTop').addClass("scroTop1");
        } else {
            $('.scroTop').removeClass("scroTop1");
        }
    });
});
//快速导航
$(function(){
    $('.link1').click(function(){$('html,body').animate({scrollTop:$('#business').offset().top}, 800);});
    $('.link2').click(function(){$('html,body').animate({scrollTop:$('#service').offset().top}, 800);});
    $('.link3').click(function(){$('html,body').animate({scrollTop:$('#area').offset().top}, 800);});
    $('.link4').click(function(){$('html,body').animate({scrollTop:$('#schedule').offset().top}, 800);});
    $('.link5').click(function(){$('html,body').animate({scrollTop:$('#commend').offset().top}, 800);});
    $('.link6').click(function(){$('html,body').animate({scrollTop:$('#works').offset().top}, 800);});
    $('.link7').click(function(){$('html,body').animate({scrollTop:$('#reviews').offset().top}, 800);});
});
$(function(){

    //文章页左侧导航
    $(".articleL ul li").click(function(){
        $(this).toggleClass("cur").siblings().removeClass("cur");
        $(this).children("h3").slideToggle().parent(".articleL ul li").siblings().children("h3").slideUp();
    });
    //动态加class
    $(".screen li em a,.screen li label a,.page a,.detatR h3 .detaEm1,.scroTop a,.title1 label a").click(function(){
        $(this).addClass("cur").siblings().removeClass("cur");
    });
    $(".detatR h4 span").click(function(){
        $(this).toggleClass("cur").siblings().removeClass("cur");
    });
    //购物车
    $(".cartBox table tr th label,.cartBox .cartJs h2 label").click(function(){
        $(this).toggleClass("on");

    })
    //当选中所有商家去选选中
    $(".cartBox table tr td label").click(function(){
        $(this).toggleClass("on");
        //选中商家个数
        var $length = $('.selectDiv:checked').length;
        $(".stores em").text($length);
    })
    $(".cartBox .cartJs .cartLa").click(function(){
        $(this).addClass("on").siblings().removeClass("on");
    })
    //删除
    $(".cartBox table tr td em").click(function(){
        $(this).parents(".cartBox table tr").remove();
    });
    //全选
    $("#checkAll").click(function(){
        if(this.checked){
            $("td label").addClass("on");
            $("td :checkbox[name='subBox']").prop("checked", true);
            $(".stores em").text($('.selectDiv').length);
        }else{
            $("td label").removeClass("on");
            $("td :checkbox[name='subBox']").prop("checked", false);
            $(".stores em").text(0);
        }
    });
    dianjixuanzekuang = function() {
        if ($('.selectDiv').length == $('.selectDiv:checked').length) {
            $('#checkAll').prop({
                checked : true
            });
            $("th label").addClass("on");
        } else {
            $('#checkAll').prop({
                checked : false
            });
            $("th label").removeClass("on");
        }
    }
    $(".selectDiv").click(function(){
        dianjixuanzekuang();
    });
    /* 商品轮播图（带缩略图的轮播效果） */
    $(".thum").thumbnailImg({
        large_elem: ".large_box",
        small_elem: ".small_list",
        left_btn: ".left_btn",
        right_btn: ".right_btn"
    });



})




//表单
window.onload = function ()
{
    var aForm = document.getElementsByTagName("form");
    //多个表单
    for (var i = 0; i < aForm.length; i++) WellForm(aForm[i]);
};



/*------------------------------------------------- +
 可以将以下JS保存为文件, 方便调用
 使用方法：WellForm(element) //element 为表单元素
 +------------------------------------------------- */

// 获取class
function getClass(sClass, oParent)
{
    var aClass = [];
    var reClass = new RegExp("(^| )" + sClass + "( |$)");
    var aElem = (oParent || document).getElementsByTagName("*");
    for (var i = 0; i < aElem.length; i++) reClass.test(aElem[i].className) && aClass.push(aElem[i]);
    return aClass
}
// class是否存在
function hasClass(obj, sClass)
{
    var reg = new RegExp("(^|\\s)" + sClass + "(\\s|$)");
    return reg.test(obj.className)
}
// 添加class
function addClass(obj, sClass)
{
    hasClass(obj, sClass) || (obj.className += " "+sClass)
}
// 删除class
function removeClass(obj, sClass)
{
    if (hasClass(obj, sClass))
    {
        var reg = new RegExp("(^|\\s)" + sClass + "(\\s|$)");
        obj.className = obj.className.replace(reg, "");
    }
}
// 上一个元素
function prevElement(obj)
{
    return obj.previousSibling || obj.previousElementSibling || null
}
// 下一个元素
function nextElement(obj)
{
    return obj.nextSibling || obj.nextElementSibling || null
}
// 自定义表单函数
function WellForm(form)
{
    var i = 0;
    var zIndex = 1;
    var aInput = form.getElementsByTagName("input");
    var aSelect = form.getElementsByTagName("select");
    var aTextArea = form.getElementsByTagName("textarea");
    form.className = "WellForm";



    /* 单选框 */
    var aRadio = [];
    for (i = 0; i < aInput.length; i++) aInput[i]["type"] == "radio" && aRadio.push(aInput[i]);

    for (i = 0; i < aRadio.length; i++)
    {
        var oRadio = document.createElement("div");
        oRadio.className = "WellRadio";

        aRadio[i].parentNode.insertBefore(oRadio, aRadio[i]);
        oRadio.appendChild(aRadio[i]);

        aRadio[i].checked && addClass(aRadio[i].parentNode, "WellRadioH");

        oRadio.onclick = function ()
        {
            var siblings = getClass("WellRadio", this.parentNode);
            for (i = 0; i < siblings.length; i++)
            {
                removeClass(siblings[i], "WellRadioH");
                siblings[i].children[0].checked = false;
            }
            addClass(this, "WellRadioH");
            this.children[0].checked = true
        }
    }

    /* 复选框 */
    var aCheckBox = [];
    for (i = 0; i < aInput.length; i++) aInput[i]["type"] == "checkbox" && aCheckBox.push(aInput[i]);

    for (i = 0; i < aCheckBox.length; i++)
    {
        var oCheckBox = document.createElement("div");
        oCheckBox.className = "WellCheckBox";

        aCheckBox[i].parentNode.insertBefore(oCheckBox, aCheckBox[i]);
        oCheckBox.appendChild(aCheckBox[i]);

        aCheckBox[i].checked && addClass(aCheckBox[i].parentNode, "WellCheckBoxH");

        oCheckBox.onclick = function ()
        {
            this.children[0].checked = !this.children[0].checked;
            this.children[0].checked ? addClass(this, "WellCheckBoxH") : removeClass(this, "WellCheckBoxH")
        }
    }

}

/**
 * 渲染商家档期展示页面
 * @param date 日期
 */
function renderSchedule(date, sche) {
    var _dateObj = formatDate(date, 'yyyy-MM');
    var _year = date.getFullYear();
    // 获取当前时间月份
    var _month = date.getMonth();
    _month = _month < 10 ? '0' + _month : _month;
    // 根据月份获取当前月份天数
    var days = getDateByMonth(_dateObj);
    $('#schedule .calendar h2:eq(0) em').remove();
    $('#schedule .calendar h2:eq(1) em').remove();
    $('#schedule .calendar h2:eq(2) em').remove();
    $('#schedule .calendar h2:eq(3) em').remove();
    // 获取当前时间第一天的星期数
    var _week = parseInt(date.getDay());
    var _weeks = ["七", "一", "二", "三", "四", "五", "六"];
    for (var i = 1; i <= days; i++, _week++) {
        // 渲染日期天数
        $('#schedule .calendar h2:eq(0)').append('<em>' + i + '</em>');

        // 渲染星期数
        if (_week > 6) {
            _week = 0;
        }
        $('#schedule .calendar h2:eq(1)').append('<em>' + _weeks[_week] + '</em>');
        if (sche && sche != '') {
            var _m = parseInt(_month) + 1;
            var _1 = _year + (_m < 10 ? '0' + _m : _m) + (i < 10 ? '0' + i : i);
            $('#schedule .calendar h2:eq(2)').append('<em id="lunch_' + _1 + '" class="ico"></em>');
            $('#schedule .calendar h2:eq(3)').append('<em id="dinner_' + _1 + '" class="ico"></em>');
        }
    }
    if (sche && sche != '') {
        var _scheObj = eval('(' + sche + ')');
        for (var key in _scheObj) {
            var _value = _scheObj[key];
            if (_value && _value == 'greyClass') {
                $('#lunch_' + key + ', #dinner_' + key).addClass('ico');
            } else {
                if (_value && _value == 'redClass') {
                    $('#lunch_' + key + ', #dinner_' + key).addClass('ico1');
                } else if (_value && _value == 'lunchClass') {
                    $('#lunch_' + key).addClass('ico1');
                } else if (_value && _value == 'dinnerClass') {
                    $('#dinner_' + key).addClass('ico1');
                }
            }
        }
    }
}

/**
 * 文本框时间改变事件
 */
function md_date_change(datas) {
    _conditions.conv_date = datas;
    byIndexSearchData(_conditions);
}

//广告点击事件
var ggFunction = function(type,url,userId,descn){
    if(userId != '' && userId != null){
        loadDetailPage(userId);
    }else {
        descnWebShow = descn;
        navPills('articleDetails1Html');
    }
}

var gaogFunctionPage = function(type) {
    $('.mainDiv').load('by/compereHtml', {}, function() {
        listDivHidden();
        gaogFunction(type)
    });
}

//广告点击事件
var gaogFunction = function(type){
    $("#keyId").val(type);
    var _defaults = {
        "parent_id": -1,
        "key_id": type,
        "position_id": 0,
        "style_type": 0,
        "price": 0,
        "area": 0,
        "city": showMainCity, // 所选城市
        "page": 1
    }
    var _data = $.extend({}, _defaults);
    if (!_data.orderBy || _data.orderBy == '') {
        _data.orderBy = ' (SELECT count(1) from by_user_biz_auth a where u.id = a.user_id) desc ';
    }
    $.ajax({
        url: "by/merchants",
        data: _data,
        error: function(e) {
        },
        success: function(ret) {
            console.log(ret)
            $('#com_list_ul').empty();
            if (ret && ret.total && ret.total > 0) {
                var bizList = ret.bizList;
                if (bizList && bizList.length > 0) {
                    for (var i = 0, len = bizList.length; i < len; i++) {
                        var biz = bizList[i];
                        var $li = $('<li ' + (i % 4 == 3 ? 'style="margin-right: 0px; float: right;"' : '') + '></li>');
                        var $li_div = $('<div class="caseM"></div>');
                        var img = (biz.bizCover && biz.bizCover != '' ? (biz.bizCover + '!500x500') : (biz.avatar + '!500x500'));
                        var $li_div_img = $('<img style="cursor: pointer" src="http://img.boyitongcheng.com/' + img + '" ' +
                            'onerror="javascript: this.src=\'/by-webhtml/assets/image/noImg.png\'"/>');
                        var $li_div_a = $('<a href="javascript:;">' + (biz.cnName && biz.cnName != '' ? biz.cnName : '未知') + '</a>');
                        var $li_div_h5 = $('<h5>￥' + (biz.bizPrice && biz.bizPrice != '' ? biz.bizPrice : '0') + '</h5>');
                        var $li_div_h5_span = '<span>${1}${2}${3}</span>';
                        var ut_1 = '', ut_2 = '', ut_3 = '';
                        var _authList = biz.authList;
                        _authList.forEach(function (auth) {
                            if (auth.authType == 1) {
                                ut_1 = '<img class="zzImg" src="/common/icon/platform.gif" width="40px" height="40px" title="平台认证"/>';
                            } else if (auth.authType == 2) {
                                ut_2 = '<img class="zzImg" src="/common/icon/credit.gif" width="40px" height="40px" title="诚信认证"/>';
                            } else {
                                if (auth.authLevel == 1) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/primary.gif" width="40px" height="40px" title="个人-初级认证"/>';
                                } else if (auth.authLevel == 2) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/middle.gif" width="40px" height="40px" title="个人-中级认证"/>';
                                } else if (auth.authLevel == 3) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/senior.gif" width="40px" height="40px" title="个人-高级认证"/>';
                                } else if (auth.authLevel == 4) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/master.gif" width="40px" height="40px" title="个人-大师认证"/>';
                                } else if (auth.authLevel == 5) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/director.gif" width="40px" height="40px" title="个人-总监认证"/>';
                                } else if (auth.authLevel == 6) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/crown.gif" width="40px" height="40px" title="个人-皇冠认证"/>';
                                } else if (auth.authLevel == 7) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/king.gif" width="40px" height="40px" title="个人-金冠认证"/>';
                                } else if (auth.authLevel == 8) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/one_star.gif" width="40px" height="40px" title="团队-一星白银团队"/>';
                                } else if (auth.authLevel == 9) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/two_star.gif" width="40px" height="40px" title="团队-二星黄金团队"/>';
                                } else if (auth.authLevel == 10) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/three_star.gif" width="40px" height="40px" title="团队-三星白金团队"/>';
                                } else if (auth.authLevel == 11) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/four_star.gif" width="40px" height="40px" title="团队-四星钻石团队"/>';
                                } else if (auth.authLevel == 12) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/five_star.gif" width="40px" height="40px" title="团队-五星大师团队"/>';
                                } else if (auth.authLevel == 13) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/six_star.gif" width="40px" height="40px" title="团队-六星皇冠团队"/>';
                                } else if (auth.authLevel == 14) {
                                    ut_3 = '<img class="zzImg" src="/common/icon/seven_star.gif" width="40px" height="40px" title="团队-七星至尊团队"/>';
                                }
                            }
                        });
                        $li_div_h5_span = $li_div_h5_span.replace('${1}', ut_1).replace('${2}', ut_2).replace('${3}', ut_3);
                        $li_div_h5.prepend($li_div_h5_span);
                        var $li_div_h6 = $('<h6><em class="ico">评论：' + (biz.bizCommentCount && biz.bizCommentCount != '' ? biz.bizCommentCount : '0') + '</em>' +
                            '<em class="ico1">好评：' + (biz.bizStar && biz.bizStar != '' ? biz.bizStar : '0') + '</em>' +
                            '<em class="ico2">浏览：' + (biz.bizViewCount && biz.bizViewCount != '' ? biz.bizViewCount : '0%') + '</em></h6>');
                        var $li_div_hide = $('<input type="hidden" value="' + biz.id + '"/>');
                        $li_div.append($li_div_img).append($li_div_a).append($li_div_h5).append($li_div_h6).append($li_div_hide);
                        $li.append($li_div);
                        $('#com_list_ul').append($li);
                    }
                } else {
                    $('#com_list_ul').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
                }
                if (ret.total > ret.pageSize) {
                    PageUtils(ret.currentPage, ret.pageSize, ret.total);
                }
            } else {
                $('#com_list_ul').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
            }
        }
    });

    // $.ajax({
    //     type: "POST",
    //     url: "usersWeb/findAllUserChannelByUserId.json",
    //     data: {channelId: type, page: 1, pageNum: 20},
    //     success: function(ret) {
    //         $('#com_list_ul').empty();
    //         if (ret && ret.numSum && ret.numSum > 0) {
    //             var bizList = ret.userList;
    //             if (bizList && bizList.length > 0) {
    //                 $('#com_list_ul').empty();
    //                 for (var i = 0, len = bizList.length; i < len; i++) {
    //                     var biz = bizList[i];
    //                     var $li = $('<li ' + (i % 4 == 3 ? 'style="margin-right: 0px; float: right;"' : '') + '></li>');
    //                     var $li_div = $('<div class="caseM"></div>');
    //                     var img = (biz.bizCover && biz.bizCover != '' ? (biz.bizCover + '!500x500') : (biz.avatar + '!500x500'));
    //                     var $li_div_img = $('<img src="http://img.boyitongcheng.com/' + img + '" ' +
    //                         'onerror="javascript: this.src=\'/by-webhtml/assets/image/noImg.png\'"/>');
    //                     var $li_div_a = $('<a href="javascript:;">' + (biz.cnName && biz.cnName != '' ? biz.cnName : '未知') + '</a>');
    //                     var $li_div_h5 = $('<h5>￥' + (biz.bizPrice && biz.bizPrice != '' ? biz.bizPrice : '0') + '</h5>');
    //                     var $li_div_h6 = $('<h6><em class="ico">评论：' + (biz.bizCommentCount && biz.bizCommentCount != '' ? biz.bizCommentCount : '0') + '</em>' +
    //                         '<em class="ico1">好评：' + (biz.bizStar && biz.bizStar != '' ? biz.bizStar : '0') + '</em>' +
    //                         '<em class="ico2">浏览：' + (biz.bizViewCount && biz.bizViewCount != '' ? biz.bizViewCount : '0%') + '</em></h6>');
    //                     var $li_div_hide = $('<input type="hidden" value="' + biz.id + '"/>');
    //                     $li_div.append($li_div_img).append($li_div_a).append($li_div_h5).append($li_div_h6).append($li_div_hide);
    //                     $li.append($li_div);
    //                     $('#com_list_ul').append($li);
    //                 }
    //             } else {
    //                 $('#com_list_ul').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
    //             }
    //             if (ret.total > ret.pageSize) {
    //                 PageUtils(ret.pageSum, 20, ret.numSum);
    //             }
    //         } else {
    //             $('#com_list_ul').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
    //         }
    //     }
    // })
}

var ggwzFunction = function(name,update_time,url,userId,descn,type){
    // alert(descnShow);
    // debugger
    if(url != '#'){
        if(userId != '' && userId != null){
            loadDetailPage(userId);
        }else {
            $('.mainDiv').load('articleDetails1Html', {}, function() {
                listDivHidden();
                $("#adv_title").html(name == 'null' ? '': name);
                $("#adv_time").html(update_time);
                $("#adv_content").html(descn == 'null' ? '': descn);
            });
        }
    }else {
        $('.mainDiv').load('articleDetails1Html', {}, function() {
            listDivHidden();
            $("#adv_title").html(name == 'null' ? '': name);
            $("#adv_time").html(update_time);
            $("#adv_content").html(descn == 'null' ? '': descn);
        });
    }
}
//针对婚礼预约，特别推荐
var ggwzFunction1 = function(name,update_time,url,userId,descn,flag,id,type){
    // debugger
    if(userId != '' && userId != null){
        loadDetailPage(userId);
    }else if(flag){
        listDivHidden();
        $('.mainDiv').load('htmlWeb/advertsListHtml', {}, function(){
            setTimeout(loadAdvThreeData(id,type),100);

        });
    }else {
        $('.mainDiv').load('articleDetails1Html', {}, function() {
            listDivHidden();
            $("#adv_title").html(name == 'null' ? '': name);
            $("#adv_time").html(update_time);
            $("#adv_content").html(descn == 'null' ? '': descn);
        });
    }
}
/**
 * 获取三级广告
 * @param id
 * @param type
 */
function loadAdvThreeData(id,type) {
    $.ajax({
        type: "get",
        url: "htmlWeb/adv/loadAdvThreeData",
        dataType : "json",
        async:false,
        data: {
            parentId: id, advType: type
        },
        error: function (e) {
            console.log(e);
        },
        success: function (result) {
            var tem = "";
            $.each( result.r, function(index, content){
                tem += "<li><div class='caseM'><img style='cursor: pointer' src='"+_imgesByUrl+content.imgUrl+"' onclick=\"ggwzFunction('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+
                    content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"/><a href='#' onclick=\"ggwzFunction('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+
                    content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a></div></li>";
            });
            $("#adversListPage").empty();
            $("#adversListPage").append(tem);
            $("#adversListPage li").css("margin-right",'10px');
        }
    });
}
//获取轮播数据
var centerLunboListFunction = function(){
    $.ajax({
        url:"getCenterLunboList.json",
        type:'GET',
        dataType:"json",
        success:function(result){
            var tem = "";
            $.each( result.centerLunboList, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                tem += "<li><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+
                    (content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"',"+_isParent+
                    ",'"+content.id+"',"+1+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a></li>";
            });
            $("#centerLunboList").empty();
            $("#centerLunboList").append(tem);
            jQuery(".bannerDiv").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });
        }
    });
}();

//获取小图轮播数据
var centerBottomListFuntion = function(){
    $.ajax({
        url:"getCenterBottomList.json",
        type:'GET',
        dataType:"json",
        success:function(result){
            var tem = "";
            $.each( result.centerBottomList, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                tem += "<a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+
                    (content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"',"+_isParent
                    +",'"+content.id+"',"+2+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a>";
            });
            $("#centerBottomList").empty();
            $("#centerBottomList").append(tem);
        }
    });
}();

//获取数据猜你喜欢top
var youLikeTOPFunction = function(){
    $.ajax({
        url:"getYouLikeTOP.json",
        type:'GET',
        dataType:"json",
        success:function(result){
            var tem = "";
            $.each( result.youLikeListT, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                tem += '<a href="#" onclick="ggwzFunction1(\''+content.name+'\',\''+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+'\',\''+
                    content.url+'\',\''+content.entityId+'\',\''+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+'\',\''+_isParent
                +'\',\''+content.id+'\',\''+3+'\');">'+content.name+'</a>';
            });
            $("#youLikeTOP").empty();
            $("#youLikeTOP").append(tem);
        }
    });
}();

//获取婚礼预约
var hunliyuyueListFunction = function(){
    $.ajax({
        url:"getHunliyuyueList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var tem = "";
            var temgg = "";
            $.each( result.hunliyuyueList, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                if(index >= 4){
                    tem += "<li class='wedImgHLYLi'><img src='"+_imgesByUrl+content.imgUrl+"' /><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+
                        (content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"',"+_isParent
                        +",'"+content.id+"',"+4+");\">"+content.name+"</a></li>";
                }else {
                    tem += "<li><img src='"+_imgesByUrl+content.imgUrl+"' /><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+
                        (content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"',"+_isParent
                        +",'"+content.id+"',"+4+");\">"+content.name+"</a></li>";
                }
            });
            $("#hunliyuyueList").empty();
            $("#hunliyuyueList").append(tem);
            $.each( result.hunliyuyueggList, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                temgg += "<a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+
                    (content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"',"+_isParent
                    +",'"+content.id+"',"+4+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a>";
            });
            $("#hunliyuyueggList").empty();
            $("#hunliyuyueggList").append(temgg);
        }
    });
}();

//获取特别推荐
var curListFuntion = function(){
    $.ajax({
        url:"getCurList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var tem = "";
            $.each( result.curList, function(index, content){
                var _isParent=content.children.length>0?true:false;
                content = content.ad;
                if(index>0 && index%4 ==0){
                    if(content.descn != null){
                        tem += "<li class='wedImgCURLi'><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+content.descn.replace(/\"/g, '&quot;')+"',"+_isParent
                            +",'"+content.id+"',"+6+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /><p>"+content.name+"</p></a></li>";
                    }else{
                        tem += "<li class='wedImgCURLi'><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'',"+_isParent
                            +",'"+content.id+"',"+6+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /><p>"+content.name+"</p></a></li>";
                    }
                }else {
                    if(content.descn != null){
                        tem += "<li><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'"+content.descn.replace(/\"/g, '&quot;')+"',"+_isParent
                            +",'"+content.id+"',"+6+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /><p>"+content.name+"</p></a></li>";
                    }else{
                        tem += "<li><a href='#' onclick=\"ggwzFunction1('"+content.name+"','"+(content.updateTime.year+"-"+content.updateTime.monthOfYear+"-"+content.updateTime.dayOfMonth)+"','"+content.url+"',"+content.entityId+",'',"+_isParent
                            +",'"+content.id+"',"+6+");\"><img src='"+_imgesByUrl+content.imgUrl+"' /><p>"+content.name+"</p></a></li>";
                    }

                }
            });
            $("#curList").empty();
            $("#curList").append(tem);
        }
    });
}();

//获取策划师
var cehuaLListFuntion = function(){
    $.ajax({
        url:"getCehuaList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var temL = "";
            $.each( result.cehuaLList, function(index, content){
                temL += "<li><h2>"+content.name+"</h2><a href='#' onclick=\"ggFunction(1,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='"+_imgesByUrl+content.imgUrl+"'/></a></li>";
            });
            $("#cehuaLList").empty();
            $("#cehuaLList").append(temL);

            var tem = "";
            var temc = "";
            $.each( result.centerList, function(index, content){
                if(index == 0){
                    tem += "<li class='selected'>"+content.ad.name+"<em></em></li>";
                    temc += "<div><ul class='plaImgList clearfix'>";
                }else {
                    tem += "<li >"+content.ad.name+"<em></em></li>";
                    temc += "<div class='conceal'><ul class='plaImgList clearfix'>";
                }
                var byAdList = content.children;
                if(byAdList != null && byAdList.length > 0) {
                    $.each(byAdList, function (index, contentc) {
                        temc += "<li><a href='#' onclick=\"ggFunction(1,'" + contentc.url + "'," + contentc.entityId + ",'" + (contentc.descn ? contentc.descn.replace(/\"/g, '&quot;') : '') + "');\"><img src='"+_imgesByUrl + contentc.imgUrl + "' /><p>" + contentc.name + "</p></a></li>";
                    });
                }
                temc += "</ul></div>";
            });
            $("#cehuaIindexPlatabMenu").empty();
            $("#cehuaIindexPlatabMenu").append(tem);
            $("#cehuaIndexPlatabBox").empty();
            $("#cehuaIndexPlatabBox").append(temc);

            var temR = "";
            $.each( result.cehuaRList, function(index, content){
                temR += "<li><a class='hotImg'><img src='"+_imgesByUrl+content.imgUrl+"' /></a><h3><a href='#' onclick=\"ggFunction(1,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a><span>"+content.descn+"</span></h3></li>";
            });
            $("#cehuaRList").empty();
            $("#cehuaRList").append(temR);

            var $tab_li = $('#cehuaIindexPlatabMenu li');
            $tab_li.click(function(){
                $(this).addClass('selected').siblings().removeClass('selected');
                var index = $tab_li.index(this);
                $('#cehuaIndexPlatabBox > div').eq(index).show().siblings().hide();
            });

            jQuery(".plaBannCH").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });
        }
    });
}();

//获取主持人
var zhuchiListFuntion = function(){
    $.ajax({
        url:"getZhuchiList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var temL = "";
            $.each( result.zhuchiLList, function(index, content){
                temL += "<li><h2>"+content.name+"</h2><a href='#' onclick=\"ggFunction(5,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='" + _imgesByUrl +content.imgUrl+"' /></a></li>";
            });
            $("#zhuchiLList").empty();
            $("#zhuchiLList").append(temL);

            var tem = "";
            var temc = "";
            $.each( result.centerList, function(index, content){
                if(index == 0){
                    tem += "<li class='selected'>"+content.ad.name+"<em></em></li>";
                    temc += "<div><ul class='plaImgList clearfix'>";
                }else {
                    tem += "<li >"+content.ad.name+"<em></em></li>";
                    temc += "<div class='conceal'><ul class='plaImgList clearfix'>";
                }
                var byAdList = content.children;
                if(byAdList != null && byAdList.length > 0) {
                    $.each(byAdList, function (index, contentc) {
                        temc += "<li><a href='#' onclick=\"ggFunction(5,'" + contentc.url + "'," + contentc.entityId + ",'" + (contentc.descn ? contentc.descn.replace(/\"/g, '&quot;') : '') + "');\"><img src='"+ _imgesByUrl + contentc.imgUrl + "' /><p>" + contentc.name + "</p></a></li>";
                    });
                }
                temc += "</ul></div>";
            });
            $("#zhuchiIndexPlatabMenu").empty();
            $("#zhuchiIndexPlatabMenu").append(tem);
            $("#zhuchiIndexPlatabBox").empty();
            $("#zhuchiIndexPlatabBox").append(temc);

            var temR = "";
            $.each( result.zhuchiRList, function(index, content){
                temR += "<li><a class='hotImg'><img src='"+_imgesByUrl+content.imgUrl+"' /></a><h3><a href='#' onclick=\"ggFunction(5,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a><span>"+content.descn+"</span></h3></li>";
            });
            $("#zhuchiRList").empty();
            $("#zhuchiRList").append(temR);

            jQuery(".plaBannZC").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });

            var $tab_li = $('#zhuchiIndexPlatabMenu li');
            $tab_li.click(function(){
                $(this).addClass('selected').siblings().removeClass('selected');
                var index = $tab_li.index(this);
                $('#zhuchiIndexPlatabBox > div').eq(index).show().siblings().hide(); });
        }
    });
}();

//获取摄影师
var sysListFuntion = function(){
    $.ajax({
        url:"getSysList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var temL = "";
            $.each( result.sysLList, function(index, content){
                temL += "<li><h2>"+content.name+"</h2><a href='#' onclick=\"ggFunction(6,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a></li>";
            });
            $("#sysLList").empty();
            $("#sysLList").append(temL);

            var tem = "";
            var temc = "";
            $.each( result.centerList, function(index, content){
                if(index == 0){
                    tem += "<li class='selected'>"+content.ad.name+"<em></em></li>";
                    temc += "<div><ul class='plaImgList clearfix'>";
                }else {
                    tem += "<li >"+content.ad.name+"<em></em></li>";
                    temc += "<div class='conceal'><ul class='plaImgList clearfix'>";
                }
                var byAdList = content.children;
                if(byAdList != null && byAdList.length > 0){
                    $.each( byAdList, function(index, contentc){
                        temc += "<li><a href='#' onclick=\"ggFunction(6,'"+contentc.url+"',"+contentc.entityId+",'"+(contentc.descn ? contentc.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='"+_imgesByUrl+contentc.imgUrl+"' /><p>"+contentc.name+"</p></a></li>";
                    });
                }
                temc += "</ul></div>";
            });
            $("#sysIndexPlatabMenu").empty();
            $("#sysIndexPlatabMenu").append(tem);
            $("#sysIndexPlatabBox").empty();
            $("#sysIndexPlatabBox").append(temc);

            var temR = "";
            $.each( result.sysRList, function(index, content){
                temR += "<li><a class='hotImg'><img src='"+_imgesByUrl+content.imgUrl+"' /></a><h3><a href='#' onclick=\"ggFunction(6,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a><span>"+content.descn+"</span></h3></li>";
            });
            $("#sysRList").empty();
            $("#sysRList").append(temR);

            jQuery(".plaBannSYS").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });

            var $tab_li = $('#sysIndexPlatabMenu li');
            $tab_li.click(function(){
                $(this).addClass('selected').siblings().removeClass('selected');
                var index = $tab_li.index(this);
                $('#sysIndexPlatabBox > div').eq(index).show().siblings().hide();
            });
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(2)").css({'width':'238px','border-left':'1px solid #ddd','border-right':'1px solid #ddd'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(1)").css({'border-top-left-radius':'3px','border-bottom-left-radius':'3px'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(3)").css({'border-top-right-radius':'3px','border-bottom-right-radius':'3px'});
        }
    });
}();

//获取摄像师
var sxsListFuntion = function(){
    $.ajax({
        url:"getSxsList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var temL = "";
            $.each( result.sxsLList, function(index, content){
                temL += "<li><h2>"+content.name+"</h2><a href='#' onclick=\"ggFunction(22,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a></li>";
            });
            $("#sxsLList").empty();
            $("#sxsLList").append(temL);

            var tem = "";
            var temc = "";
            $.each( result.centerList, function(index, content){
                if(index == 0){
                    tem += "<li class='selected'>"+content.ad.name+"<em></em></li>";
                    temc += "<div><ul class='plaImgList clearfix'>";
                }else {
                    tem += "<li >"+content.ad.name+"<em></em></li>";
                    temc += "<div class='conceal'><ul class='plaImgList clearfix'>";
                }
                var byAdList = content.children;
                if(byAdList != null && byAdList.length > 0) {
                    $.each(byAdList, function (index, contentc) {
                        temc += "<li><a href='#' onclick=\"ggFunction(22,'" + contentc.url + "'," + contentc.entityId + ",'" + (contentc.descn ? contentc.descn.replace(/\"/g, '&quot;') : '') + "');\"><img src='"+_imgesByUrl + contentc.imgUrl + "' /><p>" + contentc.name + "</p></a></li>";
                    });
                }
                temc += "</ul></div>";
            });
            $("#sxsIndexPlatabMenu").empty();
            $("#sxsIndexPlatabMenu").append(tem);
            $("#sxsIndexPlatabBox").empty();
            $("#sxsIndexPlatabBox").append(temc);

            var temR = "";
            $.each( result.sxsRList, function(index, content){
                temR += "<li><a class='hotImg'><img src='"+_imgesByUrl+content.imgUrl+"' /></a><h3><a href='#' onclick=\"ggFunction(22,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a><span>"+content.descn+"</span></h3></li>";
            });
            $("#sxsRList").empty();
            $("#sxsRList").append(temR);

            jQuery(".plaBannSXS").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });

            var $tab_li = $('#sxsIndexPlatabMenu li');
            $tab_li.click(function(){
                $(this).addClass('selected').siblings().removeClass('selected');
                var index = $tab_li.index(this);
                $('#sxsIndexPlatabBox > div').eq(index).show().siblings().hide();
            });
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(2)").css({'width':'238px','border-left':'1px solid #ddd','border-right':'1px solid #ddd'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(1)").css({'border-top-left-radius':'3px','border-bottom-left-radius':'3px'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(3)").css({'border-top-right-radius':'3px','border-bottom-right-radius':'3px'});
        }
    });
}();

//获取化妆师
var hzsListFuntion = function(){
    $.ajax({
        url:"getHzsList.json",
        type:'GET',
        dataType:"json",
        data:{city: showMainCity},
        success:function(result){
            var temL = "";
            $.each( result.hzsLList, function(index, content){
                temL += "<li><h2>"+content.name+"</h2><a href='#' onclick=\"ggFunction(7,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\"><img src='"+_imgesByUrl+content.imgUrl+"' /></a></li>";
            });
            $("#hzsLList").empty();
            $("#hzsLList").append(temL);

            var tem = "";
            var temc = "";
            $.each( result.centerList, function(index, content){
                if(index == 0){
                    tem += "<li class='selected'>"+content.ad.name+"<em></em></li>";
                    temc += "<div><ul class='plaImgList clearfix'>";
                }else {
                    tem += "<li >"+content.ad.name+"<em></em></li>";
                    temc += "<div class='conceal'><ul class='plaImgList clearfix'>";
                }
                var byAdList = content.children;
                if(byAdList != null && byAdList.length > 0) {
                    $.each(byAdList, function (index, contentc) {
                        temc += "<li><a href='#' onclick=\"ggFunction(7,'" + contentc.url + "'," + contentc.entityId + ",'" + (contentc.descn ? contentc.descn.replace(/\"/g, '&quot;') : '') + "');\"><img src='"+_imgesByUrl + contentc.imgUrl + "' /><p>" + contentc.name + "</p></a></li>";
                    });
                }
                temc += "</ul></div>";
            });
            $("#hzsIndexPlatabMenu").empty();
            $("#hzsIndexPlatabMenu").append(tem);
            $("#hzsIndexPlatabBox").empty();
            $("#hzsIndexPlatabBox").append(temc);

            var temR = "";
            $.each( result.hzsRList, function(index, content){
                temR += "<li><a class='hotImg'><img src='"+_imgesByUrl+content.imgUrl+"' /></a><h3><a href='#' onclick=\"ggFunction(7,'"+content.url+"',"+content.entityId+",'"+(content.descn ? content.descn.replace(/\"/g, '&quot;') : '')+"');\">"+content.name+"</a><span>"+content.descn+"</span></h3></li>";
            });
            $("#hzsRList").empty();
            $("#hzsRList").append(temR);

            jQuery(".plaBannHZ").slide({
                mainCell:".bd ul",
                effect:"leftLoop",
                autoPlay:true
            });

            var $tab_li = $('#hzsIndexPlatabMenu li');
            $tab_li.click(function(){
                $(this).addClass('selected').siblings().removeClass('selected');
                var index = $tab_li.index(this);
                $('#hzsIndexPlatabBox > div').eq(index).show().siblings().hide();
            });
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(2)").css({'width':'238px','border-left':'1px solid #ddd','border-right':'1px solid #ddd'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(1)").css({'border-top-left-radius':'3px','border-bottom-left-radius':'3px'});
            // $(".planner .plannerDiv .plaTab .platab_menu ul li:nth-child(3)").css({'border-top-right-radius':'3px','border-bottom-right-radius':'3px'});
        }
    });
}();
// 加载商家详情页面(仅加载页面，数据单独加载)
function loadDetailPageBottom(obj) {
    var userId = $(obj).attr("wed_id_val")+"@"+$(obj).attr("wed_exampleType_val");
    listDivHidden();
    if(String(userId).indexOf("@") != -1){
        if(userId.split("@").length > 1 && userId.split("@")[1] == 3){
            $('.mainDiv').load('case_DetailsHtml', {}, function(){
                $("#caseIdHidden").val(userId.split("@")[0]);
                $.getScript("../../by-webhtml/assets/js/case_Details.js");
            });
        }
    }else{
        $('.mainDiv').load('by/detailHtml', {}, loadDetailData(userId));
    }
}
//获取低部猜你喜欢
var youLikeListBFuntion = function(){
    $.ajax({
        type: "get",
        url: "by/adList",
        data: {flag:'case',page:1, pageSize:10, user_id:0, parent_id:6,position_id:3,"city": showMainCity,"orderDesn":"猜你喜欢"},
        dataType: "json",
        success: function(ret) {
            var tem = "";
            $('#youLikeListB').empty();
            if (ret && ret.total && ret.total > 0) {
                var bizList = ret.bizList;
                if (bizList && bizList.length > 0) {
                    bizList.forEach(function (biz, i) {
                        if(i>0 && i%4==0){
                            tem += "<li class='wedImgCURLi'><span>" +
                                "<img src='"+(_imgesByUrl+ (biz.imgUrl ? biz.imgUrl : ''))+"' />" +
                                '<a href="javascript:void(0)" wed_id_val="'+biz.id +'" wed_exampleType_val="'+biz.exampleType +'" onclick="loadDetailPageBottom(this);">'+ (biz.name && biz.name != '' ? biz.name : '未知') + '</a>' +
                                "<h2>"+(biz.caseDetail && biz.caseDetail != '' && !isNaN(biz.caseDetail) ? biz.caseDetail : '0') +"</h2>" +
                                "<h3><em class='ico'>"+(biz.viewCount && biz.viewCount != '' ? biz.viewCount : '0') +"</em>" +
                                "<em class='ico1'>"+(biz.totalD && biz.totalD != '' ? biz.totalD : '0')+"</em></h3>" +
                                "</span></li>";
                        }else {
                            tem += "<li><span><img src='"+(_imgesByUrl+ (biz.imgUrl ? biz.imgUrl : ''))+"' />" +
                                '<a href="javascript:void(0)" wed_id_val="'+biz.id +'" wed_exampleType_val="'+biz.exampleType +'" onclick="loadDetailPageBottom(this);">'+ (biz.name && biz.name != '' ? biz.name : '未知') + '</a>' +
                                "<h2>"+(biz.caseDetail && biz.caseDetail != '' && !isNaN(biz.caseDetail) ? biz.caseDetail : '0') +"</h2>" +
                                "<h3><em class='ico'>"+(biz.viewCount && biz.viewCount != '' ? biz.viewCount : '0') +"</em>" +
                                "<em class='ico1'>"+(biz.totalD && biz.totalD != '' ? biz.totalD : '0')+"</em>" +
                                "</h3></span></li>";
                        }
                    });
                    $("#youLikeListB").append(tem);
                } else {
                    $('#youLikeListB').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
                }
            } else {
                $('#youLikeListB').append('<li style="width: 100%; font-size: 20px; text-align: center;">暂无数据！</li>');
            }
        },
        error: function (e) {
            console.log('error');
        }
    });
}();

var BannerDivPlaBann = function(){
    jQuery(".plaBann").slide({
        mainCell:".bd ul",
        effect:"leftLoop",
        autoPlay:true
    });
}

//判断是否登录
var indexHtmlTopRightFunction = function(){
    $.ajax({
        url:"loginWeb/isLogin.json",
        type:'GET',
        dataType:"json",
        success:function(result){
            var tem = "";
            if(result.isLogin == 'OK'){
                tem += "<a class=\"ico\" href=\"/systemMainHtml\">我的博艺</a><a class=\"ico1\" href=\"#\" onclick=\"unLoginFunction();\">注销</a>";
            }else {
                tem += "<a class=\"ico\" href=\"#\" onclick=\"navPills('loginHtml');\">登录</a><a class=\"ico1\" href=\"#\" onclick=\"navPills('registerHtml');\">注册</a>";
            }
            $("#indexH5Show").empty();
            $("#indexH5Show").append(tem);
        }
    });
}();

//注销
var unLoginFunction = function(){
    $.ajax({
        url:"loginWeb/unLogin.json",
        type:'GET',
        dataType:"json",
        success:function(result){
            window.location.href="/";
        }
    });
}